Fix undeterministic tests in desktop UI#496
Merged
bedaHovorka merged 2 commits intocopilot/goal-7-simulation-speed-controlfrom May 7, 2026
Merged
Fix undeterministic tests in desktop UI#496bedaHovorka merged 2 commits intocopilot/goal-7-simulation-speed-controlfrom
bedaHovorka merged 2 commits intocopilot/goal-7-simulation-speed-controlfrom
Conversation
Copilot stopped work on behalf of
bedaHovorka due to an error
May 7, 2026 10:39
… nullMainProcessNoOp (issue #495) Agent-Logs-Url: https://github.com/bedaHovorka/interlockSim/sessions/57c03945-0a5c-4b57-a850-c1a29f81f146 Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
f1e7806 to
f648bc4
Compare
bedaHovorka
approved these changes
May 7, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR stabilizes nondeterministic desktop-ui tests around SimulationController speed propagation by removing shared latch state and making thread-start synchronization explicit, addressing CI scheduling delays (Issue #495).
Changes:
- Replaced companion-object latch side-table with per-test
CountDownLatchinstance fields initialized in@BeforeEach. - Added
@AfterEachcleanup that always releases the simulation-blocking latch (and clears MockK state) to prevent lingering daemon threads across tests. - Increased all relevant awaits and
@Timeoutvalues from 10s to 30s and restoredstartedLatch.await()innullMainProcessNoOp.
|
81dd75c
into
copilot/goal-7-simulation-speed-control
14 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



copilot/goal-7-simulation-speed-controlstartedLatch.await()innullMainProcessNoOp—cf9759bremoved it, claiming "runner is assigned synchronously". True, but without the await,blockSim.countDown()can race with the sim thread starting. On a busy CI runner (maxParallelForks = availableProcessors()), the sim thread can be delayed several seconds. The 10 sblockSim.await()then expires without release → test times out.latchescompanion-objectIdentityHashMap— mutable static state shared across all test instances (MockK state + IdentityHashMap entries accumulate with no cleanup); code smell removed.@AfterEachcleanup — a test failure beforereleaseSim()left the sim daemon thread blocked for 10 s onblockSim.await().startedLatch.await(30s)innullMainProcessNoOpwith generous CI timeoutlatchesIdentityHashMap with per-testlateinitinstance fields@BeforeEach/@AfterEachto initialize and release latches, plus callunmockkAll()blockSim.await()10 s → 30 s and all@Timeout10 s → 30 s